Add Move Static Member To Existing Type#61519
Merged
ryzngard merged 81 commits intodotnet:mainfrom Jun 6, 2022
Merged
Conversation
…ot working bc of a few bugs
No behavior created after dialog exited Still working on destination type/filename selection formatting
…ox, assuming new class (c# only, no automated tests yet)
…as the semantic model cannot get the symbol for VB declared fields from the node. Fields are added as part of the dialog box however.
…oveStaticMembers Merge main to features/MoveStaticMembers
…ling due to the way AddMembers reuses syntax. Fixed a few bugs
…er2/roslyn into MoveStaticMembersNewType
… refactoring in VB, but unsure about extensions since we do not generate a module.
* WIP Dialog work * Rename + refactor * WIP rename, add xaml elements * WIP dialog/VM work * WIP, Reverted Pull Member up change, updated destination selection, not working bc of a few bugs * Refactoring provider now shows up and launches dialog No behavior created after dialog exited Still working on destination type/filename selection formatting * Rename/Refactor name to MoveStaticMembers. Feature working with textbox, assuming new class (c# only, no automated tests yet) * Accessibility, theming, resources, and sizing retweaks * Added VB refactoring provider. Currently does not trigger on fields, as the semantic model cannot get the symbol for VB declared fields from the node. Fields are added as part of the dialog box however. * Addressing some of the feedback * Fixed fields not being able to trigger dialog in VB * Remove unnecessary usings * Fixed nullable error * Added test classes for view model and C# impl, made VB able to get dependents * Finished Writing impl tests for C# and VB. VB tests are currently failing due to the way AddMembers reuses syntax. Fixed a few bugs * Fixed resources and removed nullable disable annotation * Adress small feedback points * Small test fix. Works with generator changes (sepearate PR) Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com>
… in C# to set some readonly properties
…m/ryzngard/roslyn into features/move_static_existing
JoeRobich
reviewed
May 28, 2022
src/EditorFeatures/TestUtilities/MoveStaticMembers/TestMoveStaticMembersService.cs
Show resolved
Hide resolved
Comment on lines
+2543
to
+2546
| var initialDestinationMarkup = @" | ||
| public class Class1Helpers | ||
| { | ||
| }"; |
Member
There was a problem hiding this comment.
Would be interesting to have the destination use a different namespace to see the initial source document updated with either a using directive or qualified name.
Contributor
Author
There was a problem hiding this comment.
That's a great idea, and I think good for follow up as a small fix/bug fix.
src/VisualStudio/Core/Def/MoveStaticMembers/MoveStaticMembersDialog.xaml
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/MoveStaticMembers/MoveStaticMembersDialogViewModel.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/MoveStaticMembers/MoveStaticMembersOptions.cs
Outdated
Show resolved
Hide resolved
…ticMembersService.cs Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
added 2 commits
May 30, 2022 15:45
JoeRobich
approved these changes
Jun 6, 2022
ryzngard
pushed a commit
to ryzngard/roslyn
that referenced
this pull request
Jun 8, 2022
This reverts commit 74c3abe.
ryzngard
added a commit
to ryzngard/roslyn
that referenced
this pull request
Jun 30, 2022
This reverts commit 6e46737.
ryzngard
added a commit
that referenced
this pull request
Jun 30, 2022
333fred
added a commit
that referenced
this pull request
Jul 5, 2022
…ures/semi-auto-props * upstream/main: (887 commits) Ensure elastic trivia for reusable syntax in field generator (#62346) Fix typos in the incremental generators doc (#62343) Theme The "Generate Overrides" Dialog (#62244) Walk green-nodes in incremental-generator attribute-finding path (#62295) Cache the hash in compilation options (#62289) Respect dotnet_style_namespace_match_folder (#62310) Remove unreachable condition Specify builder capacities in incremental generation to avoid wasted scratch arrays. (#62285) Skip the test (#62287) Revert "Revert "Add Move Static Member To Existing Type (#61519)"" (#62284) Highlight the search term in the options page (#61301) Synch handlers with fix (#62209) Disable integration tests Fix Set capacity of builder to avoid expensive garbage. Add public APIs for opened and closed event handling for non-source documents Handle possible null symbols in `getAttributeTarget` (#62137) Perform a lookahead rather than a parsing attempt in order to determine if current token starts a conversion operator declaration. (#62240) Fix a race in CachingDictionary. (#62248) Simplify ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports #56131 and updates slightly. I did my best to keep the initial intent of the PR because @Soreloser2 did a great job with it :)
From the original PR:
Adds support for moving static members to existing types.
Searches for types that:
Ns.Class1as our original type, thenNs.Class2andNs.ExtraNs.Class3will show, butDifferentNs.Class4will notTypes will be displayed with their full namespace qualification, any generic type parameters, and their file name (in case of partially declared types)
The user can select a pre-defined type using the dropdown menu, or type in a new, separate non-conflicting type to create a new type in a new file. New files will have an icon as well as a preview of the new type name, similar to the previous iteration of this feature. Currently existing types do not have any icon, but this is open to change based on feedback.
ExistingTypeDemo.mp4